#include "link.h"

Link::Link(QWidget *parent)
    : QWidget(parent)
{
    initUI();
}

#include <QGridLayout>
#include <QHBoxLayout>
void Link::initUI()
{
    QGridLayout *pGridLayout = new QGridLayout();

    QLabel *plabelBefore = new QLabel("前接路:", this);
    pGridLayout->addWidget(plabelBefore, 0, 0, 1, 1, Qt::AlignRight);

    QLabel *plabelBeforeID = new QLabel("ID:", this);
    m_pLabel_Before_ID = new QLabel(this);
    pGridLayout->addWidget(plabelBeforeID, 1, 0, 1, 1, Qt::AlignRight);
    pGridLayout->addWidget(m_pLabel_Before_ID, 1, 1, 1, 1, Qt::AlignRight);

    QLabel *plabelBeforeLinkType = new QLabel("连接类型:", this);
    m_pLabel_Before_LinkType = new QLabel(this);
    pGridLayout->addWidget(plabelBeforeLinkType, 2, 0, 1, 1, Qt::AlignRight);
    pGridLayout->addWidget(m_pLabel_Before_LinkType, 2, 1, 1, 1, Qt::AlignRight);

    QLabel *plabelBeforeLinkPoint = new QLabel("连接点:", this);
    m_pLabel_Before_LinkPoint = new QLabel(this);
    pGridLayout->addWidget(plabelBeforeLinkPoint, 3, 0, 1, 1, Qt::AlignRight);
    pGridLayout->addWidget(m_pLabel_Before_LinkPoint, 3, 1, 1, 1, Qt::AlignRight);

    QLabel *plabelLater = new QLabel("后续路:", this);
    pGridLayout->addWidget(plabelLater, 4, 0, 1, 1, Qt::AlignRight);

    QLabel *plabelLaterID = new QLabel("ID:", this);
    m_pLabel_Later_ID = new QLabel(this);
    pGridLayout->addWidget(plabelLaterID, 5, 0, 1, 1, Qt::AlignRight);
    pGridLayout->addWidget(m_pLabel_Later_ID, 5, 1, 1, 1, Qt::AlignRight);

    QLabel *plabelLaterLinkType = new QLabel("连接类型:", this);
    m_pLabel_Later_LinkType = new QLabel(this);
    pGridLayout->addWidget(plabelLaterLinkType, 6, 0, 1, 1, Qt::AlignRight);
    pGridLayout->addWidget(m_pLabel_Later_LinkType, 6, 1, 1, 1, Qt::AlignRight);

    QLabel *plabelLaterLinkPoint = new QLabel("连接点:", this);
    m_pLabel_Later_LinkPoint = new QLabel(this);
    pGridLayout->addWidget(plabelLaterLinkPoint, 7, 0, 1, 1, Qt::AlignRight);
    pGridLayout->addWidget(m_pLabel_Later_LinkPoint, 7, 1, 1, 1, Qt::AlignRight);

    QHBoxLayout *pHBLayout = new QHBoxLayout();
    pHBLayout->addLayout(pGridLayout);
    pHBLayout->addStretch(1);
    setLayout(pHBLayout);
}
